package com.xcw.bos.dao.base;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

import com.xcw.bos.page.PageBean;

/**
 * 抽取持久层公共方法
 * @author xcw
 *
 * @param<T>
 */
public interface IBaseDao<T> {

	public void save(T entity);
	public void delete(T eneity);
	public void update(T entity);
	public void saveOrUpdate(T entity);
	public T findById(Serializable id);
	public List<T> findAll();
	//根据命名查询语句查询，只能执行查询语句
	public List<T> findByNamedQuery(String queryName,Object...args);
	//执行命名的增删改语句
	public void executeByNamedQuery(String queryName,Object...agrs);
	//根据离线条件查询对象查询
	public List<T> findByCriteria(DetachedCriteria dc);
	//通用分页查询
	public void pageQuery(PageBean<T> pageBean);
}
